import request from '../request'
// import testRequest from '@/request/test'
export function register (account, nickname, password) {
  const data = {
    account,
    nickname,
    password
  }
  return request({
    url: '/api/user/register',
    method: 'post',
    data
  })
}

export function login (account, password) {
  const data = {
    account, password
  }
  return request({
    url: '/api/user/login',
    method: 'post',
    data
  })
}
export function logout () {
  return request({
    url: '/api/user/logout',
    method: 'get'
  })
}

export function getUserInfo () {
  return request({
    url: '/api/user/current',
    method: 'get'
  })
}
export function getCsrfToken () {
  return request({
    url: '/api/user/get_csrf_token',
    method: 'post'
  })
}
